<?php

class PaymentCompetedFbOrderAction extends SzAbstractAction
{
    Protected $paramTypes = array(
        SzAbstractAction::TYPE_INT,
        SzAbstractAction::TYPE_ARRAY
    );

    /**
     * 完成支付订单-facebook平台
     * @param int $userId 玩家ID
     * @param array $paymentData 支付返回
     * @return SzResponse
     */
    public function execute($userId, $paymentData)
    {
        $result = PayService::get()->completePaymentOrder('facebook', ['userId' => $userId, 'data' => $paymentData]);
        if ($result instanceof SzAbstractMySqlVo) {
            return $this->buildResponse($result->toArray());
        } else {
            return $this->buildResponse($result);
        }
    }
}